﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBTMDT.Dal;

namespace DBTMDT.Biz
{
    class BizAdmin
    {
        public int Id { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public int Role { get; set; }

        public BizAdmin()
        {
            this.Id = -1;
        }

        public BizAdmin(int Id, string UserName, string Password, int Role)
        {
            this.Id = Id;
            this.UserName = UserName;
            this.Password = Password;
            this.Role = Role;
        }

        public BizAdmin(string UserName, string Password, int Role)
        {
            
            this.UserName = UserName;
            this.Password = Password;
            this.Role = Role;
        }

        public void Save()
        {
            if (this.Id == -1)
                this.Id = DalAdmin.Insert(this);
            else
                DalAdmin.Update(this);
        }


    }
}
